Tom Wellige Posted September 3, 2019 #1 Posted September 3, 2019 The following forum topic is restored from the Swyx Forum Archive (2007-2014) Quote 2011-03-02 09:33:38, palloquin Hi, I've just started testing with Swyx, and run in to all kinds of questions.. One of them is: Is there any way to include a library of often used VBScript functions in an ECR script? I understand I can put a copy of the code in the start action, but I want a single central library that I reference (like an "include" statement) Any thoughts? Quote 2011-03-02 10:05:30, Tom Wellige Hi, as you might know VBScript does not support "inlcude" statements like you know from other languages. As Swyx needed that functionality for the SwyxWare call routing scripts there is actually an include statement available in call routing scripts. Only problem is: all call routing scripts, even those that are included, need to have a valid digital signature. A tool to create such signatures for own VBScript files is available to Swyx partners only. But there is an easy and elegant (and more call routing like) solution for your problem: create a call routing script in the GSE place your code into the Start block connect the start block with the Rule skipped exit place the rule on top of the list of rule in the call routing manager and activate it By doing so your code is available in all call routing scripts of the current script user. If you need your code available for all users: open the call routing manager click on Sequence of Actions... click on New to create a new GSE Action place your code into the start block connect the Start block with the Action Executed exit save it, i.e. like MyLibrary use either the IpPbx File Explorer (from SwyxWare 7 - 2015 DVD) or the SwyxWare Administration (Properties - Files) to download the actionMyLibrary.ase and actionMyLibrary.vbs files upload these files again, but select Global scope now this GSE Action is available for all users To make use of this global action, i.e. get your code included into any script of any user: use a GSE Action block in the desired call routing script script select your Action MyLibrary (System) done! If you need to update the code in your GSE Action: open the call routing manager click on Sequence of Actions... right click the MyLibrary (System) entry in the left list and select Edit GSE Action in this moment, before the GSE opens your current user get a copy of this action into his User scope, the all other user continue to work on the version still available in the Global scope do the necessary changes in your code and save the GSE action use either the IpPbx File Explorer (from SwyxWare 7 - 2015 DVD) or the SwyxWare Administration (Properties - Files) to download the actionMyLibrary.ase and actionMyLibrary.vbs files upload these files again into Global scope now this updated GSE Action is available for all users An example for using a SwyxWare include statement can be found in the Open Queue project here on Swyx Forum. It includes an own (and signed) vbscript file containg a database provider VBScript class definition. An example of using a global GSE Action to provide own VBScript code to all call routing scripts can be found in the Persistent Variables extension which is part of the Open ECR Extensions project. Hope this helps. Tom.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.